DEF_PROJECT=../../..
include $(DEF_PROJECT)/scripts/main.mk
name=mysql
version=5.1.67
prefix=/usr
destdir=$(DIR_SYSROOT)
extdeps=eglibc-tools gcc-tools binutils-tools linux-header-tools

DL_SERV=http
DL_HOST=downloads.mysql.com
DL_PATH=archives/$(name)-$(basename $(version))
DL_SUFFIX=tar.gz

cflags+=--host=$(CC_TARGET)
cflags+=--build=$(CC_HOST)
cflags+=--cache-file=$(DEF_CACHE)
cflags+=--without-docs
cflags+=--without-man
#cflags+=--without-bench
cflags+=--without-debug
#cflags+=--without-innodb
#cflags+=--without-blackhole-storage-engine
cflags+=--without-example-storage-engine
#cflags+=--without-archive-storage-engine
#cflags+=--without-innodb-storage-engine
cflags+=--without-federated-storage-engine
cflags+=--without-innodb_plugin-storage-engine
cflags+=--without-plugin-ftexample
cflags+=--without-plugin-daemon_example
cflags+=--with-pthread
#cflags+=--enable-thread-safe-client
cflags+=--with-charset=utf8
cflags+=--with-extra-charsets=gb2312,gbk,ascii,big5
cflags+=--with-big-tables
#cflags+=--with-mysqlmanager=no
#cflags+=--disable-dependency-tracking
cflags+=--with-plugins=partition,archive,blackhole,csv,heap,innobase,myisam,myisammrg,ndbcluster
pre-build:
	-$(MAKE) -C $< clean
	cd $<;CFLAGS=-I$(DIR_TOOLS)/include LDFLAGS=-L$(DIR_TOOLS)/lib ./configure --without-server --with-plugins=none
	$(MAKE) -C $</include my_config.h
	$(MAKE) -C $</vio libvio.a
	$(MAKE) -C $</mysys libmysys.a
	$(MAKE) -C $</dbug libdbug.a
	$(MAKE) -C $</regex libregex.a
	$(MAKE) -C $</strings libmystrings.a
	$(MAKE) -C $</zlib libzlt.la
	$(MAKE) -C $</sql gen_lex_hash
	cp -a $</sql/gen_lex_hash $</sql/gen_lex_hash.host
	-$(MAKE) -C $< clean
	echo "ac_cv_sys_restartable_syscalls='yes'" >$</$(DEF_CACHE)
	echo "ac_cv_c_stack_direction=-1" >>$</$(DEF_CACHE)
	cd $<;$(cdefs) ./configure $(cflags)
	sed -i 's@\./gen_lex_hash@\0.host@' $</sql/Makefile

normal-build:

post-build:
